<?php

namespace App\Http\Requests;

class StoreGoodsAddOneRequest extends BasicRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'goods_name'		    => 'required',
            'summary'               => 'required',
            'cate_id'               => 'required|numeric',
            'stock'                 => 'required|numeric',
        ];
    }
    
    public function messages()
	{
		return [
			'goods_name.required'		    => '请填写商品标题',
            'summary.required'              => '请填写商品简介',
            'cate_id.required'              => '请填写商品分组',
            'cate_id.numeric'               => '请填写商品分组',
            'stock.required'                => '请填写商品数量',
            'stock.numeric'                 => '请填写商品数量',
		];
	}
}
